#ifndef __ERROR_H
#define __ERROR_H

#include "cconf.h"

typedef enum {
	CCONF_ERROR_NO_ERROR = 0,
	CCONF_ERROR_BAD_FILE,
	CCONF_ERROR_ENTRY_EXISTS,
	CCONF_ERROR_NO_SUCH_ENTRY,
	CCONF_ERROR_FAILED_SANITY,
    CCONF_ERROR_TABLE_FULL,
    CCONF_ERROR_INVALID,
    CCONF_ERROR_NOMEM,
    CCONF_ERROR_GENERIC
} cconf_error_t;

typedef struct error_s {
    char * error;
    cconf_error_t code;
    int level;
    int count;
    struct error_s * next;
} cconf_error_stack_t;

cconf_error_stack_t * cconf_pop_error(cconf_t * c);
int cconf_push_error(cconf_t * c, char * error, int dup, int bottom);
int cconf_push_error_code(cconf_t * c, cconf_error_t err, int level);

char * cconf_error_str(cconf_error_t err);



#endif
